/*
 * Creative Bulletin Board Generation 3
 * Version 1.0 Beta 1
 +------------------------------------
 * CBB User Interface Javascript
 * Started: August 23, 2009 8:51:20 AM
 +------------------------------------
 */

// DOM Events should be placed in .ready().
$(document).ready(function(){
	//-------------------------------
	// QTip
	// Create the modal backdrop on document load so all modal tooltips can use it
	$('<div id="qtip-blanket">')
		.css({
			position: 'absolute',
			top: $(document).scrollTop(),
			left: 0,
			height: $(document).height(),
			width: '100%',
			opacity: 0.7,
			backgroundColor: 'black',
			zIndex: 5000
		})
		.appendTo($("body")) // Append to the document body
		.hide(); // Hide it initially
	// Then tooltip me
	$('a[href][title]').qtip({ style: 'cream' });
});

//-------------------------------
// Collapse / Expand Tables
function toggle(id){
	$("#table-"+id).slideToggle(350, function(){
		img = document.getElementById("image-"+id);
		if($("#table-"+id).is(":hidden")) {
			img.src = img.src.replace(/up/gi, "down");
		}
		else{
			img.src = img.src.replace(/down/gi, "up");
		}
	});
}

//-------------------------------
// Re-CAPTCHA!
var RecaptchaOptions = {
	theme : 'clean'
};
